package com.yang.xiao.hui.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate;

@Controller
public class OrderContorller {
    @Autowired
    private RestTemplate restTemplate;
    @RequestMapping("/info/{id}")
    public String getProductInfo(@PathVariable Integer id){
      return restTemplate.getForObject("http://product/info/" + id, String.class);
    }
}
